﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;

namespace HCQ2_Model.VRQDMeta.InputDto._20220418
{
    /// <summary>
    ///  保存视频动态
    /// </summary>
    public class VideoNewsInput
    {
        /// <summary>
        ///  创建用户编码
        /// </summary>
        [Required(ErrorMessage ="创建用户编码必填！")]
        public string userid { get; set; }
        /// <summary>
        ///  保存视频的地址
        /// </summary>
        [Required(ErrorMessage = "视频的地址必填！")]
        public string videoUrl { get; set; }
        /// <summary>
        ///  保存视频缩略图的地址
        /// </summary>
        [Required(ErrorMessage = "视频缩略图的地址必填！")]
        public string imageUrl { get; set; }
        /// <summary>
        ///  商品ID（元宇宙房间、元宇宙应用、度度圈商品）； 可以传0，表示不关联商品
        /// </summary>
        [Required]
        public int fileID { get; set; }
        /// <summary>
        ///  隐私 【0=仅自己可见；1=好友可见；2=所有人可见】
        /// </summary>
        public int visitType { get; set; }
        /// <summary>
        ///  经度
        /// </summary>
        public decimal gpsX { get; set; }
        /// <summary>
        ///  纬度
        /// </summary>
        public decimal gpsY { get; set; }
        /// <summary>
        ///  位置名称
        /// </summary>
        public string locationName { get; set; }
        /// <summary>
        ///  描述
        /// </summary>
        public string note { get; set; }

        /// <summary>
        ///  转实体
        /// </summary>
        /// <returns></returns>
        public T_VRDDVideoDynamic toEntry()
        {
            return new T_VRDDVideoDynamic
            {
                userid = this.userid,
                fileID = this.fileID,
                fileType = 0,
                visitType = this.visitType,
                gpsX = this.gpsX,
                gpsY = this.gpsY,
                video = this.videoUrl,
                image = this.imageUrl,
                locationName = this.locationName,
                newsStatus = 0,
                note = this.note,
                starNum = 0,
                sharedNum = 0,
                create_date = DateTime.Now
            };
        }
    }
}